package com.juc.juc_project.syncContainer;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * Created by fangjicai on 2020/4/8.
 */
public class UnmodifiableTest {


    public static  final List<String> list=new ArrayList<>();
    static {
        list.add("1");
        list.add("2");
        list.add("3");
    }
    public static void main(String[] args) {
        System.out.println(list.toString());
        List<String> list2 = Collections.unmodifiableList(list);
        list2.add("4");
    }
}
